package com.kede.app.converenum;

import lombok.AllArgsConstructor;
import lombok.Getter;

/***
 ** @Author:Pr.li
 ** @Description:
 ** @Date: create in 2023/5/23 15:54
 ***/
@Getter
@AllArgsConstructor
public enum ClassifConverEnum implements PersistEnum2DB<Integer,String>{
    INDEX("index","首页",1),
    HOT("hot","热门",2),
    RECOMMEND("recommend","推荐",3),
    NEW("new","最新",4);

    private String code;
    private String value;
    private Integer index;
    @Override
    public Integer toColType() {
        return index;
    }

    @Override
    public String toEnumCode() {
        return code;
    }

    public static class Converter extends AbstractEnumConverter<ClassifConverEnum,Integer,String>{
        public Converter() {
            super(ClassifConverEnum.class);
        }
    }
}
